<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('工作时间修改')" />
</head>
<body>
	<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
		<legend>上午打卡时间</legend>
	</fieldset>
	<div class="layui-form">
		<div class="layui-form-item">
			<label class="layui-form-label">时间范围：</label>
			<div class="layui-input-inline">
				<input type="text" class="layui-input" id="am" placeholder="HH:mm:ss - HH:mm:ss" readonly>
			</div>
		</div>
	</div>
	<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
		<legend>中午打卡时间</legend>
	</fieldset>
	<div class="layui-form">
		<div class="layui-form-item">
			<label class="layui-form-label">时间范围：</label>
			<div class="layui-input-inline">
				<input type="text" class="layui-input" id="nm" placeholder="HH:mm:ss - HH:mm:ss" readonly>
			</div>
		</div>
	</div>
	<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
		<legend>下午打卡时间</legend>
	</fieldset>
	<div class="layui-form">
		<div class="layui-form-item">
			<label class="layui-form-label">时间范围：</label>
			<div class="layui-input-inline">
				<input type="text" class="layui-input" id="pm" placeholder="HH:mm:ss - HH:mm:ss" readonly>
			</div>
		</div>
	</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
   /*<![CDATA[*/
	//定义全局通用参数
	var workDateSet=[[${workDateSet}]],
		fields=[[${fields}]],
		guid=window.location.href.split("=")[1];
   /*]]>*/
</script>
<script type="text/javascript">
var $,layer,form,laydate,element;//定义layui模块
var noTable,nid = $("#nid").val()//定义全局参数
layui.use(['laydate','form','layer','jquery','util','element'], function () {
 	$ = layui.$,layer = layui.layer,form = layui.form,laydate = layui.laydate,util = layui.util,element=layui.element;
 	laydate.render({elem: '#am',type: 'time',range: true,trigger:'click',done:function(value, date, endDate){
 		workDateSet.aMHS=date.hours;
 		workDateSet.aMMS=date.minutes;
 		workDateSet.aMSS=date.seconds;
 		workDateSet.aMHE=endDate.hours;
 		workDateSet.aMME=endDate.minutes;
 		workDateSet.aMSE=endDate.seconds;
 	}});
 	laydate.render({elem: '#nm',type: 'time',range: true,trigger:'click',done:function(value, date, endDate){
 		workDateSet.nMHS=date.hours;
 		workDateSet.nMMS=date.minutes;
 		workDateSet.nMSS=date.seconds;
 		workDateSet.nMHE=endDate.hours;
 		workDateSet.nMME=endDate.minutes;
 		workDateSet.nMSE=endDate.seconds;
 	}});
 	laydate.render({elem: '#pm',type: 'time',range: true,trigger:'click',done:function(value, date, endDate){
 		workDateSet.pMHS=date.hours;
 		workDateSet.pMMS=date.minutes;
 		workDateSet.pMSS=date.seconds;
 		workDateSet.pMHE=endDate.hours;
 		workDateSet.pMME=endDate.minutes;
 		workDateSet.pMSE=endDate.seconds;
 	}});
 	$('#am').val(appendZero(workDateSet.aMHS)+':'+appendZero(workDateSet.aMMS)+':'+appendZero(workDateSet.aMSS)+' - '+appendZero(workDateSet.aMHE)+':'+appendZero(workDateSet.aMME)+':'+appendZero(workDateSet.aMSE));
 	$('#nm').val(appendZero(workDateSet.nMHS)+':'+appendZero(workDateSet.nMMS)+':'+appendZero(workDateSet.nMSS)+' - '+appendZero(workDateSet.nMHE)+':'+appendZero(workDateSet.nMME)+':'+appendZero(workDateSet.nMSE));
 	$('#pm').val(appendZero(workDateSet.pMHS)+':'+appendZero(workDateSet.pMMS)+':'+appendZero(workDateSet.pMSS)+' - '+appendZero(workDateSet.pMHE)+':'+appendZero(workDateSet.pMME)+':'+appendZero(workDateSet.pMSE));
})
function callbackdata(){
	if(!$('#am').val()){
		return '请选择上午时间！';
	}
	if(!$('#nm').val()){
		return '请选择中午时间！';
	}
	if(!$('#pm').val()){
		return '请选择下午午时间！';
	}
	workDateSet.vWorkType='班';//统一把有改动的设置为班
	var pd=[];
	pd.push(workDateSet);
	return pd;
}
</script>
</body>
</html>